package FreshmenTest00;
import java.util.*;

/**
 * Enjoy programming!!!
 * Time: 2021/10/31 -  15:31
 */
public class Sum {//两种方法：前者是用等差数列求和公式；后者是loop

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int n = in.nextInt();
        int sum;
        sum = (2 * a + n - 1) * 2;
        System.out.println(sum);


    }
}

class Main{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int n = in.nextInt();
        int sum = 0;
        for (int i = 0; i < n; i++)
            sum = sum + a + i;
        System.out.println(sum);

    }
}